package com.syg.case06;

import org.springframework.aop.support.AopUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ControllerCase06 {

    @Resource
    ACase06 aCase06;

    /**
     * 情况6：类没被aop增强，但是类中方法有@Transactional注解
     * 执行结果：true ， 是代理类。
     */
    @RequestMapping(value = "/case06",method = RequestMethod.GET)
    public void proxyClassTest(){
        // aopProxy1结果是true 此时是通过AOP增强的对象,因为切入点配置到了类
        boolean aopProxy1 = AopUtils.isAopProxy(aCase06);
        System.out.println("proxyClassTest result = " + aopProxy1);
    }
}
